% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/FIPS_FUNCTIONS.R
\name{counties_as_sites}
\alias{counties_as_sites}
\title{FIPS - Analyze US Counties as if they were sites, to get EJ indicators summary for each county}
\usage{
counties_as_sites(fips)
}
\arguments{
\item{fips}{County FIPS vector,
like fips_counties_from_state_abbrev("DE")}
}
\value{
provides table similar to the output of getblocksnearby(),
data.table with one row per blockgroup in these counties, or
all pairs of county fips - bgid, and ejam_uniq_id (1 through N) assigned to each county
but missing blockid and distance so not ready for doaggregate().
}
\description{
FIPS - Analyze US Counties as if they were sites, to get EJ indicators summary for each county
}
\details{
This function provides one row per blockgroup.
\code{\link[=getblocksnearby_from_fips]{getblocksnearby_from_fips()}} provides one row per block.
See more below under "Value"
}
\examples{
 
 # compare counties within a state:
 fipsRI = fips_counties_from_state_abbrev("RI")
 x = counties_as_sites(fipsRI)
 out = doaggregate(x) # similar to ejamit()
 ejam2barplot_sites(out, "pop", names.arg = fipsRI)
 
 # compare two specific counties:
 counties_as_sites(c('01001','72153'))
 
 # Largest US Counties by ACS Population Totals:
 topcounties = blockgroupstats[ , .(ST = ST[1], countypop = sum(pop)),
  by = .(FIPS = substr(bgfips,1,5))][order(-countypop),][1:20, .(
    CountyPopulation = prettyNum(countypop, big.mark = ","), FIPS, ST)]
 
 myfips = topcounties$FIPS
 
 # simplest map of top counties
 map_shapes_leaflet(shapes = shapes_counties_from_countyfips(myfips))
 
 # simplest way to get and map EJ stats on counties
 out_c1 = ejamit(fips = myfips)
 mapfastej_counties(out_c1$results_bysite)
   
 # another way to get and map EJ stats on counties
 s2b = counties_as_sites(myfips)
 out_c2 = doaggregate(s2b) 
 # but without URLs/links to reports
 bysite = out_c2$results_bysite
 bysite$ejam_uniq_id <- myfips
 mapfastej_counties(bysite)
  
}
\seealso{
\code{\link[=getblocksnearby_from_fips]{getblocksnearby_from_fips()}}
}
